-
Notifications
You must be signed in to change notification settings - Fork 4
feat: setup-metagram #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: setup-metagram #121
Conversation
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (1)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThis change introduces a new SvelteKit-based web application scaffold under Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant SvelteKitApp
participant ServerHooks
participant ParaglideMiddleware
User->>SvelteKitApp: Request page
SvelteKitApp->>ServerHooks: handle(request)
ServerHooks->>ParaglideMiddleware: process(request)
ParaglideMiddleware-->>ServerHooks: returns (modifiedRequest, locale)
ServerHooks->>SvelteKitApp: resolve(modifiedRequest)
SvelteKitApp-->>ServerHooks: HTML response
ServerHooks->>User: HTML (with %paraglide.lang% replaced by locale)
Assessment against linked issues
Poem
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 12
🔭 Outside diff range comments (6)
platforms/metagram/README.md (1)
38-39
:⚠️ Potential issueRemove stray backticks and fix formatting.
There's a stray ``` fence at the end of the file that isn't closing any explicit code block. This will render incorrectly in Markdown. Remove the extra backticks and ensure the note about adapters ends with a period:
-> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. -``` +> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment.platforms/metagram/project.inlang/cache/plugins/ygx0uiahq6uw (1)
1-17
: 🛠️ Refactor suggestionMinified cache artefact checked into VCS
The file is 1 600+ LOC of minified JS located under
project.inlang/cache/…
.
These files are generated by Inlang and can be recreated at build time; committing them bloats the repo, hinders review, and risks licence issues.Move the cache directory to
.gitignore
(or commit the readable TS source + build script instead).platforms/metagram/project.inlang/cache/plugins/2sy648wh9sugi (4)
1560-1580
:⚠️ Potential issueIncorrect RegExp –
{languageTag|locale}
is matched literally, breaking validationThe
en
schema usespattern: ".*\\{languageTag|locale\\}.*\\.json$"
Inside a RegExp, the sequence
...{languageTag|locale}...
is interpreted literally (it is not an alternation).
As a result, only the string{languageTag|locale}
passes the validation, while the intended{locale}
or{languageTag}
never match.-var en = ce.Type.String({ - pattern: ".*\\{languageTag|locale\\}.*\\.json$", +var en = ce.Type.String({ + // allow either {locale} or {languageTag} + pattern: ".*\\{(?:languageTag|locale)\\}.*\\.json$",This bug prevents valid configurations from being accepted at runtime.
Please update the pattern and (if any) adjust the examples/tests.
1780-1795
: 🛠️ Refactor suggestionUnnecessary arrow-function indirection when writing JSON
saveMessages
contains:await e.writeFile( s["plugin.inlang.messageFormat"].pathPattern.replace("{languageTag}", p), (T => JSON.stringify(T, void 0, " "))({ $schema: "...", ...l }) )Creating an arrow function only to call it immediately harms readability and triggers extra allocations.
await e.writeFile( - s["plugin.inlang.messageFormat"].pathPattern.replace("{languageTag}", p), - (T => JSON.stringify(T, void 0, " "))({ - $schema: "https://inlang.com/schema/inlang-message-format", - ...l - }) + s["plugin.inlang.messageFormat"].pathPattern.replace("{languageTag}", p), + JSON.stringify( + { $schema: "https://inlang.com/schema/inlang-message-format", ...l }, + null, + 2 // two-space indent is standard and avoids TAB chars in JSON + ) )This is simpler, faster and easier to debug.
1810-1830
: 🛠️ Refactor suggestion
Cn()
re-implementspath.dirname
and is OS-sensitiveThe custom
Cn
function attempts to derive a directory path by string/char-code manipulation.
Issues:
- It assumes forward slashes (
/
) – will fail on Windows paths containing\
.- It is difficult to read, test and maintain.
- Node already provides
import { dirname } from "path"
which is fully tested and cross-platform.Recommendation:
- import { /* other imports */, dirname as pathDirname } from "node:path"; ... - const dir = Cn(filePath); + const dir = pathDirname(filePath); ... - function Cn(s) { /* 40 lines of custom logic */ } +// ‑ remove custom Cn implementation – stdlib is saferDropping bespoke path parsing eliminates edge-case bugs and reduces code size.
10-40
: 🛠️ Refactor suggestionHuge bundled/minified dependency bloats repository
The file embeds ~3 k lines of minified TypeBox + helper libraries.
Consequences:• ≈130 KB unminified source committed to VCS
• Difficult to diff, review, debug and track CVEs
• License headers are stripped – may violate upstream licensePrefer installing
@sinclair/typebox
(and other helpers) vianpm
and import the needed symbols:import { Type, Static } from "@sinclair/typebox";This keeps the plugin tree-shakeable, clearer, and ensures you receive upstream security fixes.
🧹 Nitpick comments (25)
platforms/metagram/README.md (3)
1-4
: Refine the title and description for clarity.The current heading
# sv
is too generic and doesn't reflect that this README is for the Metagram project. Consider updating it to:# Metagram A SvelteKit-based application setup powered by the `sv` CLI.This will make the purpose immediately clear for developers.
5-15
: Clarify prerequisites and command context.The "Creating a project" instructions assume
sv
is available vianpx
, but it may help to note that the CLI is installed as part of this setup or provide a link to installation instructions. Also, specify that these commands should be run from the directory where you want the app. For example:Before running the commands below, ensure you're in an empty directory or specify the target folder.
29-36
: Building & preview section is clear.The steps to build and preview the project are accurate. Consider adding a brief note on cleaning the build output if necessary (e.g., when switching branches).
platforms/metagram/src/stories/button.css (1)
1-30
: Accessibility enhancements: add focus styles & verify contrast.
Add a visible focus indicator for keyboard users:
.storybook-button:focus-visible { outline: 2px solid #555ab9; outline-offset: 2px; }Confirm that the primary color
#555ab9
on white meets WCAG AA contrast (4.5:1). If not, consider darkening the shade or adjusting text color.platforms/metagram/project.inlang/project_id (1)
1-1
: Add a trailing newline for POSIX compliance.Ensure there is a newline at the end of this file to avoid issues with POSIX tools and diff utilities.
platforms/metagram/src/routes/demo/+page.svelte (1)
1-1
: Consider adding SvelteKit prefetch for smoother navigation
You may optionally enhance UX by prefetching the demo route:<a sveltekit:prefetch href="/demo/paraglide">Paraglide demo</a>platforms/metagram/src/routes/+page.svelte (1)
1-2
: Customize the landing page for Metagram branding
The default SvelteKit welcome text is fine for initial scaffolding but consider renaming to something like “Welcome to Metagram” and addingrel="noopener noreferrer"
on external links:-<h1>Welcome to SvelteKit</h1> +<h1>Welcome to Metagram</h1> -<p>Visit <a href="https://svelte.dev/docs/kit">svelte.dev/docs/kit</a> to read the documentation</p> +<p>Visit <a href="https://svelte.dev/docs/kit" rel="noopener noreferrer">SvelteKit docs</a> for more details</p>platforms/metagram/messages/es.json (1)
3-3
: Improve Spanish translation.
The"hello_world"
entry currently contains an English string. Consider providing a proper Spanish translation, for example"¡Hola, {name}!"
, to ensure meaningful localization.platforms/metagram/src/hooks.ts (2)
3-3
: Add explicit TypeScript types toreroute
.
Declare therequest
parameter type (e.g.,RequestEvent
from@sveltejs/kit
) and specify the return typestring
. This enhances type safety and IDE support.
1-3
: Ensurereroute
has unit test coverage.
No tests currently exercise this function. Consider adding unit tests for URL normalization and edge cases (e.g., missing locale segments) to validate the behavior.platforms/metagram/src/stories/header.css (1)
1-33
: Consider using Tailwind instead of traditional CSS.Since the project uses Tailwind CSS (as configured in vite.config.ts), consider refactoring this CSS to use Tailwind utility classes for consistency. This would align with the project's styling approach and reduce maintenance overhead.
Additionally, the header styling doesn't appear to include responsive design considerations.
You could refactor the component to use Tailwind instead:
- .storybook-header { - display: flex; - justify-content: space-between; - align-items: center; - border-bottom: 1px solid rgba(0, 0, 0, 0.1); - padding: 15px 20px; - font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif; - }And then in the component:
<header class="flex justify-between items-center border-b border-black/10 p-[15px_20px] font-['Nunito_Sans',_'Helvetica_Neue',_Helvetica,_Arial,_sans-serif]"> <!-- Header content --> </header>platforms/metagram/src/hooks.server.ts (2)
4-10
: Add error handling to the middleware integration.The current implementation doesn't handle potential errors from the Paraglide middleware. Consider adding try/catch blocks to provide graceful fallbacks if the middleware fails.
-const handleParaglide: Handle = ({ event, resolve }) => paraglideMiddleware(event.request, ({ request, locale }) => { +const handleParaglide: Handle = async ({ event, resolve }) => { + try { + return await paraglideMiddleware(event.request, ({ request, locale }) => { + event.request = request; + + return resolve(event, { + transformPageChunk: ({ html }) => html.replace('%paraglide.lang%', locale) + }); + }); + } catch (error) { + console.error('Paraglide middleware error:', error); + // Fallback to default locale + return resolve(event, { + transformPageChunk: ({ html }) => html.replace('%paraglide.lang%', 'en') + }); + } +};
4-12
: Consider using SvelteKit's sequence helper for future middleware additions.If you plan to add more middleware in the future, refactor this to use SvelteKit's
sequence
helper to chain multiple handle functions.+import { sequence } from '@sveltejs/kit/hooks'; const handleParaglide: Handle = ({ event, resolve }) => paraglideMiddleware(event.request, ({ request, locale }) => { event.request = request; return resolve(event, { transformPageChunk: ({ html }) => html.replace('%paraglide.lang%', locale) }); }); -export const handle: Handle = handleParaglide; +// Future middleware can be added like this: +// const handleSomethingElse: Handle = async ({ event, resolve }) => { +// // Do something with the event +// return resolve(event); +// }; + +export const handle: Handle = handleParaglide; +// When you need multiple middleware: +// export const handle = sequence(handleParaglide, handleSomethingElse);platforms/metagram/src/routes/demo/paraglide/+page.svelte (1)
11-14
: Convert HTML onclick to Svelte event directivesConsider using Svelte's event directive syntax instead of HTML onclick attributes for better consistency with Svelte conventions.
<div> - <button onclick={() => setLocale('en')}>en</button> - <button onclick={() => setLocale('es')}>es</button> + <button on:click={() => setLocale('en')}>en</button> + <button on:click={() => setLocale('es')}>es</button> </div>platforms/metagram/.storybook/main.ts (2)
3-4
: Use Node.js protocol for built-in modulesUpdate the path import to use the node: protocol for better explicitness.
-import { join, dirname } from "path" +import { join, dirname } from "node:path"🧰 Tools
🪛 Biome (1.9.4)
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.(lint/style/useNodejsImportProtocol)
9-11
: Replace 'any' with a more specific return typeUsing 'any' disables type checking. Specify a more precise return type for better type safety.
-function getAbsolutePath(value: string): any { +function getAbsolutePath(value: string): string { return dirname(require.resolve(join(value, 'package.json'))) }🧰 Tools
🪛 Biome (1.9.4)
[error] 9-9: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
platforms/metagram/package.json (1)
10-12
: Consider simplifying theprepare
script.The
|| echo ''
suppresses errors fromsvelte-kit sync
. It might hide real issues during install. Consider handling failures explicitly or removing the fallback for clearer diagnostics.platforms/metagram/tsconfig.json (2)
2-13
: Explicitly include project files intsconfig
.To avoid accidentally type-checking build artifacts or irrelevant directories, you may want to add an
include
(e.g.,"src/**/*"
,"project.inlang/**/*"
) at the root level. This makes your project boundaries explicit.
14-19
: Move comments inside the JSONC object.While
tsconfig.json
supports comments, placing them outside the closing brace may confuse some tools. Consider moving these inline comments into the root object (or under a dedicated documentation key) for maintainability.platforms/metagram/src/app.html (2)
1-8
: Add a default<title>
tag.Right now, the template relies on child pages to inject
<title>
. Consider adding a fallback title inside<head>
(e.g.,<title>Metagram</title>
) so the app has a meaningful title even if a page doesn’t declare one.
9-10
: Extract inline styles to CSS.The
style="display: contents"
on the wrapper<div>
could be moved into a global CSS or a utility class for better separation of concerns and easier theming.platforms/metagram/src/stories/Header.svelte (1)
5-12
: Consider adding null checks for callback handlersThe component doesn't check if the callback handlers exist before using them. Consider adding optional chaining when calling these functions to prevent potential runtime errors.
-<Button size="small" onClick={onLogout} label="Log out" /> +<Button size="small" onClick={() => onLogout?.()} label="Log out" /> -<Button size="small" onClick={onLogin} label="Log in" /> +<Button size="small" onClick={() => onLogin?.()} label="Log in" /> -<Button primary size="small" onClick={onCreateAccount} label="Sign up" /> +<Button primary size="small" onClick={() => onCreateAccount?.()} label="Sign up" />platforms/metagram/src/stories/Page.svelte (2)
10-14
: Duplicate handler logic could be refactoredThe
onLogin
andonCreateAccount
handlers perform identical actions. Consider refactoring to reuse the same handler for both events to improve maintainability.<Header {user} - onLogin={() => (user = { name: 'Jane Doe' })} + onLogin={setUser} onLogout={() => (user = undefined)} - onCreateAccount={() => (user = { name: 'Jane Doe' })} + onCreateAccount={setUser} /> +<script lang="ts"> + // Add this function to the script section + function setUser() { + user = { name: 'Jane Doe' }; + } +</script>
56-66
: SVG path data formatting issuesThe SVG path data is split across multiple lines with trailing spaces, which might cause rendering issues in some browsers. Consider using a continuous string without line breaks or trailing spaces.
- <path - d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 - 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 - 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z" - id="a" - fill="#999" - /> + <path + d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z" + id="a" + fill="#999" + />platforms/metagram/project.inlang/cache/plugins/2sy648wh9sugi (1)
1850-1870
: Plugin emitsconsole.log
during migration – side-effect in library code
$n()
logs directly to stdout:console.log("Migration to v2 ...")Logging from within a plugin library couples it to the host environment and may pollute CI outputs.
Instead, expose the migration result to the caller or inject a logger:- console.log("Migration to v2 of the inlang-message-format plugin was successful. ...") + if (typeof settings.logger === "function") { + settings.logger( + "info", + "Migration to v2 of the inlang-message-format plugin was successful. Please delete ..." + ); + }At minimum, guard behind
process.env.NODE_ENV !== "test"
or provide a verbose flag.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (16)
platforms/metagram/src/stories/assets/accessibility.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/accessibility.svg
is excluded by!**/*.svg
platforms/metagram/src/stories/assets/addon-library.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/assets.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/context.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/discord.svg
is excluded by!**/*.svg
platforms/metagram/src/stories/assets/docs.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/figma-plugin.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/github.svg
is excluded by!**/*.svg
platforms/metagram/src/stories/assets/share.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/styling.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/testing.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/theming.png
is excluded by!**/*.png
platforms/metagram/src/stories/assets/tutorials.svg
is excluded by!**/*.svg
platforms/metagram/src/stories/assets/youtube.svg
is excluded by!**/*.svg
platforms/metagram/static/favicon.png
is excluded by!**/*.png
📒 Files selected for processing (38)
platforms/metagram/.gitignore
(1 hunks)platforms/metagram/.npmrc
(1 hunks)platforms/metagram/.prettierignore
(1 hunks)platforms/metagram/.prettierrc
(1 hunks)platforms/metagram/.storybook/main.ts
(1 hunks)platforms/metagram/.storybook/preview.ts
(1 hunks)platforms/metagram/README.md
(1 hunks)platforms/metagram/eslint.config.js
(1 hunks)platforms/metagram/messages/en.json
(1 hunks)platforms/metagram/messages/es.json
(1 hunks)platforms/metagram/package.json
(1 hunks)platforms/metagram/project.inlang/cache/plugins/2sy648wh9sugi
(1 hunks)platforms/metagram/project.inlang/cache/plugins/ygx0uiahq6uw
(1 hunks)platforms/metagram/project.inlang/project_id
(1 hunks)platforms/metagram/project.inlang/settings.json
(1 hunks)platforms/metagram/src/app.css
(1 hunks)platforms/metagram/src/app.d.ts
(1 hunks)platforms/metagram/src/app.html
(1 hunks)platforms/metagram/src/hooks.server.ts
(1 hunks)platforms/metagram/src/hooks.ts
(1 hunks)platforms/metagram/src/lib/index.ts
(1 hunks)platforms/metagram/src/routes/+layout.svelte
(1 hunks)platforms/metagram/src/routes/+page.svelte
(1 hunks)platforms/metagram/src/routes/demo/+page.svelte
(1 hunks)platforms/metagram/src/routes/demo/paraglide/+page.svelte
(1 hunks)platforms/metagram/src/stories/Button.stories.svelte
(1 hunks)platforms/metagram/src/stories/Button.svelte
(1 hunks)platforms/metagram/src/stories/Configure.mdx
(1 hunks)platforms/metagram/src/stories/Header.stories.svelte
(1 hunks)platforms/metagram/src/stories/Header.svelte
(1 hunks)platforms/metagram/src/stories/Page.stories.svelte
(1 hunks)platforms/metagram/src/stories/Page.svelte
(1 hunks)platforms/metagram/src/stories/button.css
(1 hunks)platforms/metagram/src/stories/header.css
(1 hunks)platforms/metagram/src/stories/page.css
(1 hunks)platforms/metagram/svelte.config.js
(1 hunks)platforms/metagram/tsconfig.json
(1 hunks)platforms/metagram/vite.config.ts
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
platforms/metagram/.storybook/main.ts
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
[error] 9-9: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
🪛 GitHub Actions: Check Lint
platforms/metagram/package.json
[error] 1-1: pnpm install failed due to outdated lockfile. The pnpm-lock.yaml is not up to date with package.json dependencies. Use 'pnpm install --no-frozen-lockfile' to bypass this in CI.
🪛 GitHub Actions: Check Code
platforms/metagram/package.json
[error] 1-1: pnpm install failed due to outdated lockfile. The pnpm-lock.yaml is not up to date with package.json dependencies. Run 'pnpm install --no-frozen-lockfile' to update the lockfile.
🪛 GitHub Actions: Check Format
platforms/metagram/package.json
[error] 1-1: pnpm install failed due to outdated lockfile. The pnpm-lock.yaml is not up to date with package.json dependencies. Run 'pnpm install --no-frozen-lockfile' to update the lockfile.
🔇 Additional comments (32)
platforms/metagram/README.md (1)
17-27
: Development instructions look good.The examples for
npm run dev
are clear, concise, and follow common SvelteKit patterns.platforms/metagram/.npmrc (1)
1-1
: Ensureengines
are specified in package.json for engine-strict to take effect.With
engine-strict=true
, npm will block installs unlesspackage.json
declares anengines.node
field. Please verify thatplatforms/metagram/package.json
includes the appropriate Node.js version constraint, or add:"engines": { "node": ">=18.0.0" }to align with your CI and local environments.
platforms/metagram/.prettierignore (1)
1-6
: Prettier ignore configuration is appropriate
Lock files from various package managers are correctly excluded from formatting to prevent churn.platforms/metagram/messages/en.json (1)
1-4
: Localization message schema and content look correct
The$schema
reference is valid and thehello_world
key uses parameter syntax consistent withinlang
.platforms/metagram/.prettierrc (1)
6-9
:✅ Verification successful
Verify installation of Prettier plugins
Ensure that bothprettier-plugin-svelte
andprettier-plugin-tailwindcss
are declared indevDependencies
so they’re picked up by Prettier.Run this from the repo root to confirm:
🏁 Script executed:
#!/bin/bash rg '"prettier-plugin-svelte"' package.json rg '"prettier-plugin-tailwindcss"' package.jsonLength of output: 94
🏁 Script executed:
#!/bin/bash # Search all package.json files in the repo for the Prettier plugins fd package.json -x grep -Hn '"prettier-plugin-svelte"' {} || true fd package.json -x grep -Hn '"prettier-plugin-tailwindcss"' {} || trueLength of output: 302
Prettier plugins are declared in devDependencies
I’ve verified that bothprettier-plugin-svelte
andprettier-plugin-tailwindcss
appear inplatforms/metagram/package.json
underdevDependencies
(lines 30–31). No further action is needed.platforms/metagram/project.inlang/settings.json (1)
3-6
: Verify plugin modules configuration.
You’ve declared two external modules (message-format and m-function-matcher). Confirm whether the@inlang/plugin-m-function-matcher
requires its own configuration section (e.g.,plugin.inlang.mFunctionMatcher
). If so, add it here.platforms/metagram/svelte.config.js (1)
1-10
: Static adapter configuration looks good.
Using@sveltejs/adapter-static
with default settings is appropriate for static site generation. No issues found.platforms/metagram/src/routes/+layout.svelte (1)
1-8
: Layout component structure is valid.
Global CSS is correctly imported and content is rendered via the Svelte 4{@render children()}
API. This matches the expected pattern for layouts.platforms/metagram/vite.config.ts (1)
1-15
: Vite configuration looks well-structured and complete.The configuration correctly integrates Tailwind CSS, SvelteKit, and Paraglide localization with appropriate plugin ordering. This provides a solid foundation for the Metagram SvelteKit application with internationalization support.
platforms/metagram/src/app.d.ts (2)
3-11
: Well-prepared TypeScript declaration file for SvelteKit.The file correctly follows SvelteKit conventions for type declarations. The commented interfaces serve as placeholders that can be uncommented and extended as needed when implementing features that require type augmentation.
13-13
: Empty export is correctly included.The empty export statement ensures this file is treated as a module, which is required for global augmentation to work properly in TypeScript.
platforms/metagram/.storybook/preview.ts (1)
1-14
: Storybook preview configuration is set up correctly.The configuration properly defines control matchers for colors and dates, which will automatically apply appropriate controls in the Storybook UI. This follows Storybook best practices for control type inference.
platforms/metagram/src/stories/Page.stories.svelte (3)
1-16
: Well-structured Storybook setup with proper metadata configurationThe story setup follows Storybook best practices, properly importing necessary utilities and configuring the component metadata with appropriate layout parameters.
18-28
: Excellent use of Storybook's testing capabilitiesThe play function effectively tests the component's login/logout functionality with proper assertions and async/await handling, demonstrating good component testing practices.
30-30
: Good baseline story implementationThe "Logged Out" story provides a clean baseline representation without additional configuration, allowing for easy visual verification of the component's default state.
platforms/metagram/src/routes/demo/paraglide/+page.svelte (3)
1-6
: Well-structured imports for localization and navigationThe script properly imports necessary modules from the paraglide runtime and SvelteKit app utilities.
10-10
: Good implementation of localized message with parameterThe component correctly uses the message function with a parameter object to display a localized greeting.
14-16
: Helpful developer experience enhancementGood inclusion of a link to the VSCode extension that improves the i18n development experience.
platforms/metagram/.storybook/main.ts (1)
12-26
: Well-structured Storybook configurationThe configuration correctly defines story patterns, essential addons, and the SvelteKit framework, following Storybook best practices.
platforms/metagram/.gitignore (3)
1-9
: Comprehensive exclusion of dependencies and build outputsThe .gitignore properly excludes node_modules and various build output directories for different deployment targets.
15-19
: Good environment variable handlingProperly ignores environment files while making appropriate exceptions for example and test configurations, following security best practices.
25-26
: Appropriate exclusion of generated codeCorrectly ignores the Paraglide-generated files, which should not be committed to version control.
platforms/metagram/src/stories/page.css (3)
1-9
: Styling for the Storybook container is clear and consistent.The base
.storybook-page
rules set up a clean centered layout with sensible typography defaults. No issues found.
11-35
: Semantic element styling looks great.Headings, paragraphs, links, and lists are all styled appropriately and follow a coherent visual hierarchy.
37-68
: Tip component styles are well-defined.The
.tip
and.tip-wrapper
classes provide clear visual emphasis and spacing. No concerns here.platforms/metagram/src/stories/Header.stories.svelte (2)
1-22
: Story metadata is well-configured.The
defineMeta
call correctly sets up the title, component, autodocs, layout, and default action handlers. Everything follows Storybook’s SvelteCSF conventions.
24-27
: Stories cover key interaction states.Both “Logged In” and “Logged Out” stories are defined, providing clear examples of the component’s behavior.
platforms/metagram/src/stories/Button.stories.svelte (2)
1-22
: Well-structured Storybook setup with proper configurationThe Storybook configuration is set up correctly with appropriate metadata, controls, and actions. The story definition follows best practices by using
defineMeta
, setting up autodocs, and providing proper controls for the component props.
24-31
: Good story variants covering different component statesThe stories effectively demonstrate the Button component in different states (Primary, Secondary, Large, Small), which is excellent for documentation and testing purposes.
platforms/metagram/src/stories/Header.svelte (1)
34-43
: Clean conditional rendering implementationThe component correctly uses Svelte's conditional rendering to switch between logged-in and logged-out states, providing a good user experience.
platforms/metagram/src/stories/Page.svelte (1)
5-5
: Using Svelte's $state for reactive dataGood use of Svelte's $state syntax for managing the user state reactively. This is a modern Svelte feature that simplifies state management.
platforms/metagram/eslint.config.js (1)
25-39
: Good configuration for Svelte files with TypeScript supportThe configuration for Svelte files with TypeScript support is well-structured and comprehensive, ensuring proper parsing and linting for Svelte components.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
platforms/metagram/src/routes/+page.svelte (3)
1-1
: This is a good start, but consider enhancing the main page with more content.The heading clearly identifies the application, but as the main landing page for Metagram, it would benefit from additional content to provide context and guide users.
Consider expanding this page with:
-<h1 class="text-5xl text-red-500">Metagram</h1> +<section class="container mx-auto p-4"> + <h1 class="text-5xl font-bold mb-4">Metagram</h1> + <p class="text-xl mb-6">A platform for connecting and sharing with others</p> + <!-- Add call-to-action buttons or feature highlights here --> +</section>
1-1
: Review color choice for branding consistency.The bright red color (
text-red-500
) may be a placeholder. Ensure this aligns with your application's design system and branding guidelines.If this is just a placeholder, consider using your brand's primary color:
-<h1 class="text-5xl text-red-500">Metagram</h1> +<h1 class="text-5xl text-primary">Metagram</h1>
1-1
: Add SEO-friendly metadata for the page.For better search engine optimization and social media sharing, consider adding metadata to this main page.
You can add a
<svelte:head>
element with appropriate metadata:+<svelte:head> + <title>Metagram - Connect and Share</title> + <meta name="description" content="Metagram is a platform for connecting and sharing with others" /> +</svelte:head> + <h1 class="text-5xl text-red-500">Metagram</h1>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (2)
platforms/metagram/src/routes/+layout.ts
(1 hunks)platforms/metagram/src/routes/+page.svelte
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- platforms/metagram/src/routes/+layout.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
♻️ Duplicate comments (1)
platforms/metagram/src/routes/+page.svelte (1)
1-6
: Consider implementing internationalization for text content.Since the project includes i18n setup with
@inlang/paraglide-js
as mentioned in the summary, text content should leverage the translation framework rather than using hardcoded strings.-<h1>metagram</h1> -<h2>metagram</h2> -<h3>metagram</h3> -<p>metagram</p> -<p class="small">metagram</p> -<p class="subtext">metagram</p> +<script> + import { t } from '../i18n'; +</script> + +<h1>{t('app.title')}</h1> +<h2>{t('app.subtitle')}</h2> +<h3>{t('app.section_title')}</h3> +<p>{t('app.description')}</p> +<p class="small">{t('app.additional_info')}</p> +<p class="subtext">{t('app.disclaimer')}</p>
🧹 Nitpick comments (2)
platforms/metagram/src/routes/+page.svelte (2)
1-6
: Add documentation and structural organization.As this is the main landing page for the Metagram platform, consider adding component documentation and proper structural organization following SvelteKit best practices.
+<script> + // Main landing page for Metagram platform + // Displays welcome content and introductory information +</script> + +<svelte:head> + <title>Metagram - Share your moments</title> + <meta name="description" content="Connect and share with your community on Metagram" /> +</svelte:head> + +<section aria-labelledby="main-heading"> + <h1 id="main-heading">metagram</h1> + <h2>metagram</h2> + <h3>metagram</h3> + <p>metagram</p> + <p class="small">metagram</p> + <p class="subtext">metagram</p> +</section>
1-6
: Consider adding Tailwind CSS classes.According to the summary, the project uses Tailwind CSS. Consider utilizing Tailwind classes for styling instead of relying solely on custom CSS classes.
-<h1>metagram</h1> -<h2>metagram</h2> -<h3>metagram</h3> -<p>metagram</p> -<p class="small">metagram</p> -<p class="subtext">metagram</p> +<h1 class="text-4xl font-bold text-primary mb-4">metagram</h1> +<h2 class="text-2xl font-semibold text-secondary mb-3">metagram</h2> +<h3 class="text-xl font-medium mb-2">metagram</h3> +<p class="text-base mb-4">metagram</p> +<p class="text-sm mb-2 small">metagram</p> +<p class="text-xs text-gray-500 subtext">metagram</p>
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
platforms/metagram/src/app.css
(1 hunks)platforms/metagram/src/routes/+page.svelte
(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
- platforms/metagram/src/app.css
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (4)
platforms/metagram/src/lib/types.ts (1)
1-1
: Useimport type
for type-only importsSince
SVGAttributes
is only used as a type, it's better to useimport type
to ensure the import is removed during compilation, which can help with tree-shaking.-import { type SVGAttributes } from 'svelte/elements'; +import type { SVGAttributes } from 'svelte/elements';🧰 Tools
🪛 Biome (1.9.4)
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.(lint/style/useImportType)
platforms/metagram/.storybook/main.ts (2)
3-3
: Use node: protocol for Node.js built-in modulesFor better clarity and to follow modern best practices, Node.js built-in modules should be imported with the
node:
protocol prefix.-import { join, dirname } from 'path'; +import { join, dirname } from 'node:path';🧰 Tools
🪛 Biome (1.9.4)
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.(lint/style/useNodejsImportProtocol)
9-11
: Avoid usingany
typeThe
any
type disables TypeScript's type checking. Consider using a more specific return type for better type safety.-function getAbsolutePath(value: string): any { +function getAbsolutePath(value: string): string { return dirname(require.resolve(join(value, 'package.json'))); }🧰 Tools
🪛 Biome (1.9.4)
[error] 9-9: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
platforms/metagram/src/lib/icons/Icons.stories.ts (1)
8-8
: Avoid usingany
typeUsing
any
disables TypeScript's type checking. Consider using a more specific type for the Storybook args parameter.- render: (args: any) => ({ + render: (args: Record<string, unknown>) => ({Alternatively, if you know the specific props that the Icons component accepts, you could create a proper type for it:
type IconsProps = { // Define props here }; // Then use it render: (args: IconsProps) => ({🧰 Tools
🪛 Biome (1.9.4)
[error] 8-8: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (22)
platforms/metagram/.prettierrc
(1 hunks)platforms/metagram/.storybook/main.ts
(1 hunks)platforms/metagram/.storybook/preview.ts
(1 hunks)platforms/metagram/eslint.config.js
(1 hunks)platforms/metagram/package.json
(1 hunks)platforms/metagram/project.inlang/settings.json
(1 hunks)platforms/metagram/src/app.css
(1 hunks)platforms/metagram/src/hooks.server.ts
(1 hunks)platforms/metagram/src/lib/icons/Comment.svelte
(1 hunks)platforms/metagram/src/lib/icons/CommentsTwo.svelte
(1 hunks)platforms/metagram/src/lib/icons/Flash.svelte
(1 hunks)platforms/metagram/src/lib/icons/Home.svelte
(1 hunks)platforms/metagram/src/lib/icons/Icons.stories.ts
(1 hunks)platforms/metagram/src/lib/icons/Icons.svelte
(1 hunks)platforms/metagram/src/lib/icons/Like.svelte
(1 hunks)platforms/metagram/src/lib/icons/Refresh.svelte
(1 hunks)platforms/metagram/src/lib/icons/VerticalDots.svelte
(1 hunks)platforms/metagram/src/lib/icons/index.ts
(1 hunks)platforms/metagram/src/lib/types.ts
(1 hunks)platforms/metagram/src/routes/+layout.svelte
(1 hunks)platforms/metagram/src/routes/+layout.ts
(1 hunks)platforms/metagram/src/routes/demo/paraglide/+page.svelte
(1 hunks)
✅ Files skipped from review due to trivial changes (9)
- platforms/metagram/src/lib/icons/Icons.svelte
- platforms/metagram/src/lib/icons/VerticalDots.svelte
- platforms/metagram/src/lib/icons/Refresh.svelte
- platforms/metagram/src/lib/icons/Like.svelte
- platforms/metagram/src/lib/icons/Flash.svelte
- platforms/metagram/src/lib/icons/CommentsTwo.svelte
- platforms/metagram/src/lib/icons/Comment.svelte
- platforms/metagram/src/lib/icons/index.ts
- platforms/metagram/src/lib/icons/Home.svelte
🚧 Files skipped from review as they are similar to previous changes (10)
- platforms/metagram/.prettierrc
- platforms/metagram/project.inlang/settings.json
- platforms/metagram/src/hooks.server.ts
- platforms/metagram/src/app.css
- platforms/metagram/src/routes/+layout.ts
- platforms/metagram/.storybook/preview.ts
- platforms/metagram/src/routes/+layout.svelte
- platforms/metagram/eslint.config.js
- platforms/metagram/src/routes/demo/paraglide/+page.svelte
- platforms/metagram/package.json
🧰 Additional context used
🪛 Biome (1.9.4)
platforms/metagram/.storybook/main.ts
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
[error] 9-9: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
platforms/metagram/src/lib/icons/Icons.stories.ts
[error] 8-8: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
platforms/metagram/src/lib/types.ts
[error] 1-1: All these imports are only used as types.
Importing the types with import type ensures that they are removed by the compilers and avoids loading unnecessary modules.
Safe fix: Use import type.
(lint/style/useImportType)
🔇 Additional comments (4)
platforms/metagram/src/lib/types.ts (1)
3-6
: Interface looks good for SVG icon componentsThe
ISvgProps
interface is well-designed, extending the base SVG attributes with common properties needed for icons (size and color). This will provide consistent typing across all icon components.platforms/metagram/.storybook/main.ts (1)
12-23
: Storybook configuration looks goodThe Storybook configuration is properly set up with appropriate stories pattern and necessary addons for SvelteKit. The structure follows Storybook best practices.
platforms/metagram/src/lib/icons/Icons.stories.ts (2)
3-12
: Storybook story configuration looks goodThe story is properly configured with the appropriate title, component reference, tags for autodocs, and decorators. This follows Storybook best practices.
🧰 Tools
🪛 Biome (1.9.4)
[error] 8-8: Unexpected any. Specify a different type.
any disables many type checking rules. Its use should be avoided.
(lint/suspicious/noExplicitAny)
14-16
: Default story setup is correctThe Default story is properly set up with empty args. This provides a good starting point for showcasing your icons.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
platforms/metagram/.storybook/main.ts (2)
3-3
: Update Node.js import to use the node: protocolImport Node.js built-in modules with the
node:
protocol to explicitly indicate that these are Node.js core modules. This improves code clarity and future compatibility.- import { join, dirname } from 'path'; + import { join, dirname } from 'node:path';🧰 Tools
🪛 Biome (1.9.4)
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.(lint/style/useNodejsImportProtocol)
12-23
: Consider additional Storybook addons for improved development experienceThe current Storybook configuration includes essential addons, but you might benefit from adding a few more commonly used ones:
addons: [ getAbsolutePath('@storybook/addon-essentials'), getAbsolutePath('@storybook/addon-svelte-csf'), getAbsolutePath('@chromatic-com/storybook'), + getAbsolutePath('@storybook/addon-a11y'), + getAbsolutePath('@storybook/addon-viewport'), ],The
addon-a11y
will help catch accessibility issues during development, whileaddon-viewport
provides responsive design testing capabilities.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
platforms/metagram/.storybook/main.ts
(1 hunks)
🧰 Additional context used
🪛 Biome (1.9.4)
platforms/metagram/.storybook/main.ts
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.
(lint/style/useNodejsImportProtocol)
🔇 Additional comments (2)
platforms/metagram/.storybook/main.ts (2)
5-11
: Well-documented utility functionThe
getAbsolutePath
function is well-documented with clear comments explaining its purpose for Yarn PnP and monorepo setups. This is a good practice that helps other developers understand the code.
1-24
: Good Storybook configuration for SvelteKitThe overall Storybook configuration is well-structured and correctly set up for a SvelteKit project. The story pattern includes all common story file formats, and the framework is properly configured.
🧰 Tools
🪛 Biome (1.9.4)
[error] 3-3: A Node.js builtin module should be imported with the node: protocol.
Using the node: protocol is more explicit and signals that the imported module belongs to Node.js.
Unsafe fix: Add the node: protocol.(lint/style/useNodejsImportProtocol)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🔭 Outside diff range comments (1)
platforms/metagram/src/app.css (1)
32-53
: 🛠️ Refactor suggestion
⚠️ Potential issueCritical: Replace non-standard
@theme
rule with:root
for CSS variables
The@theme
at-rule isn’t recognized by browsers or Tailwind by default. Move your CSS custom properties into a:root
selector so they’re available at runtime:-@theme { - /* fonts */ - --font-geist: 'Geist', sans-serif; - - /* colors */ - --color-black: #1f1f1f; - --color-black-800: #4c4c4c; - /* …other vars… */ - --color-brand-gradient: linear-gradient( - 91.82deg, - #4d44ef -36.17%, - #f35b5b 57.95%, - #f7a428 152.07% - ); -} +:root { + /* fonts */ + --font-geist: 'Geist', sans-serif; + + /* colors */ + --color-black: #1f1f1f; + --color-black-800: #4c4c4c; + /* …other vars… */ + --color-brand-gradient: linear-gradient( + 91.82deg, + #4d44ef -36.17%, + #f35b5b 57.95%, + #f7a428 152.07% + ); +}This ensures the variables are applied globally.
♻️ Duplicate comments (1)
platforms/metagram/src/app.css (1)
1-1
: Use official Tailwind directives instead of a generic import
The@import 'tailwindcss';
directive may not correctly apply Tailwind’s layers. Replace it with the official layer directives:@tailwind base; @tailwind components; @tailwind utilities;Or, if importing a pre-built bundle, point to
tailwindcss/tailwind.css
instead.
🧹 Nitpick comments (1)
platforms/metagram/src/app.css (1)
3-9
: Include additional font formats and verify asset path
We only declare a TTF font; consider adding WOFF2/WOFF for broader browser support. Also ensure the file lives instatic/fonts/
so the/fonts/…
URL resolves correctly. For example:@font-face { font-family: 'Geist', sans-serif; font-style: normal; font-weight: 700; font-display: swap; - src: url('/fonts/Geist-VariableFont_wght.ttf') format('truetype'); + src: url('/fonts/Geist-VariableFont_wght.woff2') format('woff2'), + url('/fonts/Geist-VariableFont_wght.woff') format('woff'), + url('/fonts/Geist-VariableFont_wght.ttf') format('truetype'); }
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
platforms/metagram/src/app.css
(1 hunks)
🔇 Additional comments (1)
platforms/metagram/src/app.css (1)
11-30
: Verify custom utilities and ensurefont-geist
is configured
You’re using@apply font-geist
extensively, but Tailwind needs a matchingfontFamily
extension intailwind.config.*
. Please confirm your config includes:theme: { extend: { fontFamily: { geist: ['Geist', 'sans-serif'] } } }Otherwise the utility classes will be purged/ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
🧹 Nitpick comments (3)
platforms/metagram/src/lib/ui/Button/Button.stories.ts (1)
1-35
: LGTM! Consider adding stories for additional button states.The Storybook stories for the Button component are well-structured and demonstrate key functionality. The implementation follows best practices with proper typing and demonstrates various button states effectively.
Consider adding stories for:
- Disabled state - to demonstrate how the button appears when disabled
- White variant - this variant is defined in the Button component but doesn't have a corresponding story
+export const Disabled = { + args: { disabled: true, children: ButtonText } +}; + +export const White = { + args: { variant: 'white', children: ButtonText } +};platforms/metagram/src/lib/ui/Button/Button.svelte (2)
89-98
: Consider refining the loading state UI.The current implementation adds a loading spinner but only blurs the button text. This approach might cause issues:
- The blur effect (
blur-xs
) may not be visually obvious enough- The spinner is always white (
text-white
), which might not contrast well with all button variantsConsider these improvements:
<div class="flex items-center justify-center duration-100" - class:blur-xs={isLoading || isSubmitting} + class:opacity-50={isLoading || isSubmitting} > {@render children?.()} </div> {#if isLoading || isSubmitting} - <div class="loading loading-spinner loading-xl absolute text-white"></div> + <div class="loading loading-spinner loading-xl absolute" class:text-white={variant !== 'white'}></div> {/if}
76-83
: Simplify class joining with thecn
utility.The current implementation uses both
cn()
and.join(' ')
, which is redundant since thecn
utility likely already handles joining classes with spaces.class={cn( - [ - classes.common, - classes.background, - classes.text, - disabled && classes.disabled, - restProps.class - ].join(' ') + classes.common, + classes.background, + classes.text, + disabled && classes.disabled, + restProps.class )}
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (7)
platforms/metagram/package.json
(1 hunks)platforms/metagram/src/lib/ui/Button/Button.stories.snippet.svelte
(1 hunks)platforms/metagram/src/lib/ui/Button/Button.stories.ts
(1 hunks)platforms/metagram/src/lib/ui/Button/Button.svelte
(1 hunks)platforms/metagram/src/lib/ui/index.ts
(1 hunks)platforms/metagram/src/lib/utils/index.ts
(1 hunks)platforms/metagram/src/lib/utils/mergeClasses.ts
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- platforms/metagram/src/lib/ui/index.ts
- platforms/metagram/src/lib/utils/mergeClasses.ts
- platforms/metagram/src/lib/utils/index.ts
- platforms/metagram/src/lib/ui/Button/Button.stories.snippet.svelte
🚧 Files skipped from review as they are similar to previous changes (1)
- platforms/metagram/package.json
🔇 Additional comments (1)
platforms/metagram/src/lib/ui/Button/Button.svelte (1)
1-127
: Good implementation of a reusable Button component!Overall, this is a well-structured and flexible button component that handles various states, variants, and async operations. The component follows good practices like:
- Proper TypeScript typing and extending HTML button attributes
- Handling async callbacks with error management
- Supporting loading and disabled states
- Dynamic styling based on variants and states
- Comprehensive documentation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just the "any" types
Other than that, lgtm
those check failures are not from what @pixel-punk-20 is working on but what @coodos needs to fix instead in his package, if you check it's coming from the |
* feat: setup-metagram * chore: tailwind css worked * feat: fonts added * feat: typography * fix: removed stories and fixed setup for icons lib * feat: icons and story file * fix: type of args in story * fix: lint errors * feat: colors added * feat: Button * fix: format and lint * fix: colors * fix: spinner * fix: code rebbit suggestions * fix: code rebbit suggestions * fix: paraglide removed * fix: lock file
* initial commit * chore: add w3id readme (#3) * chore: add w3id readme * chore: bold text * chore: better formatting * docs: add w3id details * chore: format * chore: add links * fix: id spec considerations addressal (#8) * fix: id spec considerations addressal * fix: identity -> indentifier * chore: expand on trust list based recovery * chore: expand on AKA --------- Co-authored-by: Merul Dhiman <[email protected]> * Docs/eid wallet (#10) * chore: add eid-wallet folder * chore: add eid wallet docs * feat: add (#9) * feat(w3id): basic setup (#11) * feat(w3id): basic setup * fix(root): add infrastructure workspaces * update: lock file * feat(eidw): setup tauri (#40) * Feat/setup daisyui (#46) * feat: setup-daisyui * fix: index file * feat: colors added * feat: Archivo font added * fix: postcss added * fix: +layout.svelte file added * fix: packages * fix: fully migrating to tailwind v4 * feat: add Archivo font * feat: add danger colors * feat: twmerge and clsx added * feat: shadcn function added --------- Co-authored-by: Bekiboo <[email protected]> Co-authored-by: Julien <[email protected]> * feat: add storybook (#45) * feat: add storybook * update: lockfile * feat: created connection button (#48) * created connection button * added restprops to parent class * added onClick btn and storybook * fix: make font work in storybook (#54) * Feat/header (#55) * feat: add icons lib * fix: make font work in storybook * feat: Header * feat: runtime global added, icon library created, icons added, type file added * feat: header props added * fix: remove icons and type file as we are using lib for icons * fix: heading style * fix: color and icons, git merge branch 51, 54 * fix: color * fix: header-styling * fix: classes * chore: handlers added * chore: handlers added * fix: added heading --------- Co-authored-by: Soham Jaiswal <[email protected]> * Alternative w3id diagram (#52) * Feat/cupertino pane (#49) * feat: Drawer * feat: Drawer and added a function for clickoutside in utils * fix: classes * fix: drawer button position * fix: style and clickoutside * fix: pane height * fix: border-radius * fix: drawer as bulletin * fix: styling * fix: component with inbuilt features * fix: remove redundant code * fix: remove redundant code * fix: cancel button * fix: css in storybook * fix: position * fix: height of pane * fix: remove redundant code * feat: add button action component (#47) * feat: add button action component * fix: add correct weights to Archivo fontt * feat: add base button * fix: set prop classes last * feat: improve loading state * chore: cleanup * feat: add button action component * fix: add correct weights to Archivo fontt * feat: add base button * fix: set prop classes last * feat: improve loading state * chore: cleanup * chore: add documentation * fix: configure Storybook * chore: storybook gunk removal * feat: enhance ButtonAction component with type prop and better error handling --------- Co-authored-by: JulienAuvo <[email protected]> * Feat/splash screen (#63) * feat: SplashScreen * fix: remove redundant code * fix: as per given suggestion * fix: font-size * fix: logo * feat: input-pin (#56) * feat: input-pin * fix: styling as per our design * fix: added small variant * fix: hide pin on select * fix: gap between pins * fix: color of focus state * fix: removed legacy code and also fix some css to tailwind css * fix: css * fix: optional props * feat: added color variants * Feat/improve button component (#60) * feat: add white variant * feat: add small variant * chore: update doc and story for button * chore: rename cb into callback * update: improve small size * update: modify loading style * fix: return getAbsolutePath function to storybook (#58) Co-authored-by: Bekiboo <[email protected]> * feat: add selector component (#59) * feat: add selector component * feat: improve selector + add flag-icon lib * feat: improve selector + doc * feat: add utility function to get language with country name * feat: test page for language selectors * chore: add Selector Story * chore: clean test page * fix: types * fix: normalize custom tailwind colors (#71) * feat: workflows (#64) * feat: workflows * fix: node version * fix: use pnpm 10 * fix: check message * Fix/codebase linting (#73) * fix: Check Lint / lint * fix: Check Lint / lint * fix: Check Lint / lint * fix: Check Lint / lint * fix: Check Code / lint * fix: Check Format / lint * fix: Check Code / lint * fix: Check Format / lint * fix: Check Code / lint * fix: Check Format / lint * fix: Check Code / lint * fix: Check Code / lint * fix: Check Format / lint * fix: unknown property warning * fix: unknown property warning * chore: improve args type * settings nav button :) (#75) * setting bav button all done :) * lint fixski * added component to index.ts * Feat/#32 identity card fragment (#74) * identity card * identity card * lint fixski * lint fixski * lint fixski * fixed the font weight * added component to index.ts * changed span to buttton * feat: add icon button component (#68) * feat: add icon button component * feat: finish up buttonIcon + stories * fix: update with new color naming * feat: polish button icon (and button action too) * chore: format lint * chore: sort imports * chore: format, not sure why * Feat/onboarding flow (#67) * feat: onboarding-page * fix: line height and added handlers * fix: button variant * fix: text-decoration * fix: subtext * fix: underline * fix: padding and button spacing * fix: according to design update * feat: Drawer * feat: verify-pae * fix: verify-page styling * feat: drawer for both confirm pin and add bio metrics added * feat: modal added in fragments * fix: icons and flow * feat: Identifier Card * fix: copy to clipboard * feat: e-passport page * fix: error state * fix: colors * fix: lint error * fix: lint * feat: Typography * fix: typograpy * fix: as per given suggestion * fix: font-sizing * fix: identity card implementation * fix: spacing * fix: padding * fix: padding and spacing * fix: splashscreen * fix: error state * fix: styling to avoid * fix:typo * Fix/remove daisyui (#82) * refactoring: remove DaisyUI + refactor some tailwind classes and logic * refactoring: remove DaisyUI + refactor some tailwind classes and logic * feat: add Button.Nav (#77) * feat: add Button.Nav * chore: format * chore: sort imports * update: remove unused snippet and add missing props * feat: stick to fragment definition * update: documentation * fix: stories * chore: sort imports * Feat/splashscreen animation (#81) * feat: add animation to splashScreen * feat: implement data loading logic with splash screen delay * chore: sort import * update: use ButtonIcon is IdentityCard (#78) * update: use ButtonIcon is IdentityCard * feat: refactor ButtonIcon to be used anywhere in the app * chore: format indent * chore: remove useless change * feat: setup safe area (#80) * feat: setup safe area * chore: simplify implementation * chore: format * Feat/uuidv5 generation (#61) * feat: setup uuidv5 * chore: add test for deterministic UUID * feat: add Hero fragment (#88) * feat: add Hero fragment * chore: sort imports + add doc * feat: add storage specification abstract class (#92) * feat: add storage specification abstract class * chore: format and ignore lint * chore: change format checker on w3id * feat: settings-flow (#86) * feat: settings-flow * feat: settings and language page * feat : history page * feat: change pin page * fix: height of selector * fix: pin change page * fix: size of input pin * fix: spacing of pins * feat: AppNav fragment * fix: height of page * fix: padding * fix: remove redundant code * feat: privacy page * chore: add doc * fix: error state * feat: remove redundant code * chore: used app nav component --------- Co-authored-by: JulienAuvo <[email protected]> * feat: AppNav fragment (#90) * feat: AppNav fragment * chore: add doc * feat: Main page flow (#93) * feat: create root page + layout * feat: complete main page flow beta * chore: fix ts block * chore: sort imports * feat: integrate-flows (#94) * feat: intigrate-flows * fix: spacing in e-passport page * fix: page connectivity * feat: app page transitions * fix: z index * fix: pages * fix: view transition effect on splashscreen * fix: drawer pill and cancel button removed * fix: share button removed when onboarding * fix: remove share and view button when on onboarding flow * fix: remove view button * fix: ci checks * fix: transitions * fix: transititon according to direction * fix: lint error * fix: loop holes * Feat/w3id log generation (#98) * chore: create basic log generation mechanism * chore: add hashing utility function * chore: rotation event * feat: genesis entry * feat: generalize hash function * feat: append entry * chore: basic tests * chore: add tests for rotation * feat: add malform throws * chore: add the right errors * chore: fix CI stuff * chore: add missing file * chore: fix event type enum * chore: format * feat: add proper error * chore: format * chore: remove eventtypes enum * chore: add new error for bad options * chore: add options tests * feat: add codec tests * fix: err handling && jsdoc * fix: run format * fix: remove unused import * fix: improve default error messages * fix: move redundant logic to function * fix: run format * fix: type shadow * fix: useless conversion/cast * fix: run format --------- Co-authored-by: Soham Jaiswal <[email protected]> * Feat/core id creation logic (#99) * feat: create w3id builder * fix: w3id builder * feat: add global config var for w3id * chore: add docs * chore: change rand to crng * chore: add ts type again * chore: fix lint and format * chore: add w3id tests github workflow * Feat/evault core (#100) * feat: migrate neo4j * chore: envelope logic works * chore: envelope logic works * feat: parsed envelopes search * feat: generics * feat: protocol * feat: jwt sigs in w3id * chore: stuff works * chore: tests for evault core * chore: format * chore: fix test * Feat/docker compose and docs (#101) * chore: stash dockerfile progress * fix: getEnvelopesByOntology thing * chore: fix tests * Update infrastructure/evault-core/src/protocol/vault-access-guard.ts Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: remove unused import * chore: remove package * chore: fix pnpm lock * chore: fix workflow * chore: fix port in dockerfile --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Feat/registry and evault provisioning (#106) * feat: evault provisioning * chore: fianlly fixed provisioner * feat: add logic for metadata in consul * feat: registry * chore: format * Feat/watchers logs (#114) * feat: alloc according to entropy and namespace * chore: move exports * chore: docs * feat: `whois` endpoint * feat: watcher endpoints * chore: fix format and lint * chore: fix tests * feat: web3 adapter (#115) * feat: tauri plugins setup (#97) * feat: tauri plugins setup * fix: add editorconfig * fix: add missing biome json * fix: run formatter * feat: biometry homework * feat: add pin set logic * feat: add biometric enabling logic * fix: sec controller qol * feat: stub user controller * fix: run format && lint * fix: sort imports * fix: import statement sort * feat: user controller * feat: pin flow * feat: biometrics unavailable * fix: pin input not working * feat: make checks pass * fix: scan works * fix: actions * feat: format on save * fix: coderabbit suggestions * chore: run format lint check * fix: scan on decline too * feat: documentation links (#117) * feat: bad namespace test (#116) * fix: layouts (#119) * fix: layouts * fix: Onboarding page scroll fixed * fix: page layout and prevent from scroll in all devices * fix: pages layout * chore: try to fix emulator * fix: units * fix: safezones for ios * fix: styling --------- Co-authored-by: Soham Jaiswal <[email protected]> * feat: setup-metagram (#121) * feat: setup-metagram * chore: tailwind css worked * feat: fonts added * feat: typography * fix: removed stories and fixed setup for icons lib * feat: icons and story file * fix: type of args in story * fix: lint errors * feat: colors added * feat: Button * fix: format and lint * fix: colors * fix: spinner * fix: code rebbit suggestions * fix: code rebbit suggestions * fix: paraglide removed * fix: lock file * feat: added user avatar. (#130) * feat: Button (#129) * feat: Button * fix: colors of variants * feat: Input (#131) * feat: Input * feat: styling added * fix: styling * fix: styling * fix: added a new story * fix: focus states * fix: input states * Feat/settings navigation button (#140) * feat: settings-navigation-button * fix: handler added * chore: another variant added * fix: as per given suggestion * feat: BottomNav (#132) * feat: BottomNav * fix: icons * feat: profile icons created * feat: handler added * feat: handler added * fix: correct tags * fix: as per given suggestion, bottomnav moved to fragments and also implemented on page * fix: handler * chore: routes added * feat: app transitions added * fix: direction of transition * fix: transition css * fix: directionable transition * fix: used button instead of label, and used page from state * feat: added post fragment. (#137) * feat: FileInput (#150) * feat: FileInput * fix: added icon * feat: cancel upload * fix: remove redundant code * fix: usage docs added and as per requirements ' * fix: moved to framents * feat: Toggle Switch (#143) * feat: Toggle Switch * feat: Toggle Switch * fix: as per our design * fix: as per our design * feat: Label (#146) * feat: Select (#148) * feat: Select * fix: as per our design * fix: code format and as per svelte 5 * fix: font-size * fix: font-size * fix: icon * feat: message-input (#144) * feat: message-input * fix: classes merge and a files as a prop * feat: variant added * feat: icon replaced * fix: as per code rabbit suggestions * fix: icon * fix: input file button * fix: as per suggestion * fix: classes * fix: no need of error and disabled classes * fix: input * feat: invalid inputs * feat: add number input storybook --------- Co-authored-by: Soham Jaiswal <[email protected]> * feat:Drawer (#152) * feat:Drawer * feat: Drawer with clickoutside * fix: settings * Feat/metagram header (#133) * feat: added metagram header primary linear gradient. * feat: added flash icon. * feat: added secondary state of header. * feat: added secondary state of header with menu. * chore: cleaned some code. * docs: updated component docs. --------- Co-authored-by: SoSweetHam <[email protected]> * Feat/metagram message (#135) * feat: added metagram message component. * feat: added both states of message component. * docs: added usage docs. * chore: exposed component from ui. * fix: component -> fragement --------- Co-authored-by: SoSweetHam <[email protected]> * feat: modal (#154) * fix: styling of modal * fix: modal props * fix: conflicting styles * fix: styles of drawer * fix: hide scrollbar in drawer * fix: padding * fix: used native method for dismissing of drawer * feat: Context-Menu (#156) * feat: Context-Menu * fix: name of component * fix: as per suggestion * fix: action menu position * fix: class * feat: responsive-setup (#157) * feat: responsive-setup * fix: background color * fix: added font fmaily * feat: responsive setup for mobile and desktop (#159) * feat: responsive setup for mobile and desktop * fix: width of sidebar and rightaside * fix: responsive layout * feat: SideBar * fix: added some finishing touches to sidebar and button * fix: prevent pages transition on desktop * fix: icon center * feat: settings page and icon added * feat/layout-enhancement (#168) * feat/infinite-scroll (#170) * feat/infinite-scroll * fix: aspect ratio of post * fix: bottom nav background * settings page (#169) * settings page layout done * settings page layout done * formt fix * format fix * format fix * routing for settings page fixed * settings page buttons * merge conflict * settings page tertiary pages * settings pages all done * settings pages unnecessary page deleted * requested changes done * requested changes done * Feat/comments pane (#171) * feat/comments-pane * fix: overflow and drawer swipe * feat: Comment fragment * fix: comments added * fix: comment fragment * feat: Comments reply * fix: message input position * fix: post type shifted to types file * fix: one level deep only * fix: drawer should only be render on mobile * fix: comments on layout page * fix: format * feat: messages (#174) * feat: messages * feat: ChatMessae * feat: messages by id * fix: messages page * fix: icon name * fix: hide bottom nav for chat * fix: header * fix: message bubble * fix: message bubble * fix: message bubble * fix: as per suggestion * fix: messaging * chore: change from nomad to k8s (#179) * chore: change from nomad to k8s * Update infrastructure/eid-wallet/src/routes/+layout.svelte Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: uri extraction * feat: regitry stuff * feat: registry using local db * 📝 Add docstrings to `feat/switch-to-k8s` (#181) Docstrings generation was requested by @coodos. * #179 (comment) The following files were modified: * `infrastructure/evault-provisioner/src/templates/evault.nomad.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * chore: format --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * fix: make scan qr page work again (#185) * feat: Discover Page (#180) * refactor/Post (#186) * refactor/Post * fix: format and lint * fix: added dots for gallery * fix: added dots for gallery * fix: added dots for gallery * fix: plural name * feat: splash-screen (#187) * Feat/evault provisioning via phone (#188) * feat: eid wallet basic ui for verification * chore: evault provisioning * feat: working wallet with provisioning * feat: restrict people on dupes * 📝 Add docstrings to `feat/evault-provisioning-via-phone` (#189) Docstrings generation was requested by @coodos. * #188 (comment) The following files were modified: * `infrastructure/eid-wallet/src/lib/utils/capitalize.ts` * `infrastructure/evault-provisioner/src/utils/hmac.ts` Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * feat: added uploaded post view component. (#182) * feat: added uploaded post view component. * fix: fixed the outline and color. * fix: moved function to external definition. * fix: fixed the restProps. * profile page (#178) * basic layout for profile page * fixed alt text * merge conflict * profile page for other users implemented * fix: profile pages and logics * fixed all the pages of profile * fixed all the pages of profile * fix: format --------- Co-authored-by: gourav <[email protected]> * Feat/radio input (#176) * feat: added a radio button custom * docs: added name option in docs. * chore: cleaned the unnecessary classes and variables for input type radio. * fix: moved input radio to its own component. * fix: keydown events added. * feat: added settings tile component. (#184) * feat: added settings tile component. * chore: fixed the naming convention * chore: renamed callback to onclick * fix: fixed the use of restProps * fix: fixed the unnecessary onclick expose. * fix: fixed the join function params. * Feat/textarea (#194) * chore: removed redundant radio * feat: added textarea. * fix: tabindex * fix: removed type inconsitency. * Feat/mobile upload flow (#193) * fix: header logic in secondary * fix: fixed the text in header in post * feat: trying some hack to get file image input. * feat: added image input on clicking the post bottom nav * chore: got rid of non-required code. * feat: added the logic to get the images from user on clicking post tab. * feat: added store. * feat: added correct conversion of files. * feat: added the correct display of image when uploading. * feat: added settings tile to the post page and fixed the settingsTile component type of currentStatus * feat: added hte correct header for the audience page. * fix: fixed the page transition not happening to audience page. * feat: added audience setting * feat: added store to audience. * chore: removed console log * feat: added post button. * feat: correct button placement * fix: horizontal scroll * fix: positioning of the post button. * fix: protecting post route when no image is selected. * fix: improved type saftey * feat: added memory helper function * feat: added memory cleanup. * Feat/social media platforms (#195) * chore: this part works now wooohooo * chore: stash progress * chore: stash progress * chore: init message data models * feat: different socials * chore: blabsy ready for redesign * Feat/social media platforms (#196) * chore: this part works now wooohooo * chore: stash progress * chore: stash progress * chore: init message data models * feat: different socials * chore: blabsy ready for redesign * chore: add other socials * Feat/blabsy add clone (#198) * chore: clone twitter * feat: custom auth with firebase using w3ds * chore: add chat * feat: chat works with sync * feat: twittex * feat: global schemas * feat: blabsy adapter * refactor: shift some text messages to work on blabsy (#199) * chore: stash progress * chore: stash adapters * chore: stash working extractor * feat: adapter working properly for translating to global with globalIDs * feat: adapter toGlobal pristine * chore: stash * feat: adapter working * chore: stash until global translation from pictique * feat: bi-directional sync prestino * feat: bidir adapters * chore: login redir * chore: swap out for sqlite3 * chore: swap out for sqlite3 * chore: server conf * feat: messages one way * feat: ready to deploy * feat: ready to deploy * chore: auth thing pictique * chore: set adapter to node * chore: fix auth token thingy * chore: auth thing * chore: fix auth token thingy * chore: port for blabsy * feat: provision stuff * feat: provision * feat: provision * feat: provision * chore: fix sync * feat: temporary id thing * chore: android * chore: fix mapper sync * chore: fallback * feat: add error handling on stores * feat: fix issue with posts * chore: fix retry loop * Fix/author details (#229) * fix: author-details * fix: owner-details * fix: author avatar * fix: auth user avatar * fix: error handling * fix: author image in bottom nav --------- Co-authored-by: Merul Dhiman <[email protected]> * Fix/change name (#228) * fix: corrected the name to blabsy * fix: extra shit comming. * fix: fixed the alignment of the display in more to look more like current twitter. * fix: avatars (#226) * fix: avatars * fix: avatar in follow request page * fix: images uploaded shown in user profile * fix: button size * fix: avatar --------- Co-authored-by: Merul Dhiman <[email protected]> * chore: temp fix sync * chore: stash progress * Fix/post context menu (#231) * fix: post-context-menu * fix: user id with post * fix: removed redundant code * fix: images * fix: profile data * fix: profile data * fix: image cover * fix: logout * Fix/wallet text (#234) * changed text as per the request and fixed styling on pages with useless scroll * added settings button in main page which went missing somehow * fix: consistent padding * chore: change tags * feat: change icon * feat: webhook dynamic registry * feat: make camera permission work properlyh * chore: removed all locking mechanism thing from platforms * feat: synchronization works perfectly * feat: fixed everything up * feat: changes * chore: stats fix * chore: fix pictique visual issues * chore: fix cosmetic name issue * feat: fix sync issue * chore: fix logical issue here * chore: add qrcode ename * feat: add packages (#235) * feat: add packages * feat: add sample funcs + docs * fixed the filled color on like icon for liked post (#239) * feat: fake passport name * feat: double confirmation * chore: fix pictique login issue * fix: make no user case redir to login * fix: issues with wallet --------- Co-authored-by: Soham Jaiswal <[email protected]> Co-authored-by: SoSweetHam <[email protected]> Co-authored-by: Gourav Saini <[email protected]> Co-authored-by: Bekiboo <[email protected]> Co-authored-by: Julien <[email protected]> Co-authored-by: Ananya Rana <[email protected]> Co-authored-by: Sergey <[email protected]> Co-authored-by: Julien Connault <[email protected]> Co-authored-by: Ananya Rana <[email protected]> Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Sahil Garg <[email protected]> Co-authored-by: Sahil Garg <[email protected]>
Description of change
Setup metagram in platforms
Issue Number
closes #120
Type of change
How the change has been tested
CI and Manual
Change checklist
Summary by CodeRabbit